package asdf.trial;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Test
{

    public static void main(String[] args) throws Exception
    {
        String.class.cast(null);
    }

    public static void testDownloadFile() throws Exception
    {
        HttpClient client = HttpClients.createDefault();
        HttpResponse response = client.execute(
                new HttpGet("http://localhost:8080/homechengwenlee/Documents/passwords.txt"));
        OutputStream os = new FileOutputStream("/tmp/aaaa.txt");
        response.getEntity().writeTo(os);
        os.close();
    }

    public static void testStaticMethodOverride()
    {
        TestChild.a();
    }

    public static void abs(int i)
    {
        int n = i >> 31;
        int ret = i ^ n;
        ret = ret - n;
        System.out.println(ret);
    }

    public static void fun()
    {
        System.out.println("Test.fun");
    }

    public static void fun2()
    {
        System.out.println("Test.fun2");
    }

    public static class TestChild extends Test
    {

        public static void a()
        {
            fun();
            fun2();
        }

        public static void fun2()
        {
            System.out.println("TestChild.fun2");
        }

    }

}
